package lambdasinaction.appd;

import lambdasinaction.chap10.Person;

import java.util.function.Function;

public class InnerClass {
    Function<Object, String> f = new Function<Object, String>() {
        @Override
        public String apply(Object obj) {
            return obj.toString();
        }
    };

    Function<Person, String> fPerson = a -> a.getCar().get().getInsurance().get().getName();

    public static void main(String[] args) {
        Person p = new Person();
        InnerClass innerClass = new InnerClass();
        System.out.println(innerClass.fPerson.apply(p));
    }
}
